Bugfix for embedded translations.
authoroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 20 Nov 2005 21:24:43 +0000 (21:24 +0000)
committeroliskoli <oliskoli@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Sun, 20 Nov 2005 21:24:43 +0000 (21:24 +0000)
gpsbabel/win32/gui-2/gnugettext.pas

index 603bfc0604fe4f40deaa3d79692b3151594dc02a..23253e03c979fe4b1434d821ee2142803213bc06 100644 (file)
@@ -3,8 +3,8 @@ unit gnugettext;
 (*                                                            *)\r
 (*  (C) Copyright by Lars B. Dybdahl and others               *)\r
 (*  E-mail: Lars@dybdahl.dk, phone +45 70201241               *)\r
-(*  File version: $Date: 2005-09-28 00:33:08 $                *)\r
-(*  Revision: $Revision: 1.1 $                          *)\r
+(*  File version: $Date: 2005-11-20 21:24:43 $                *)\r
+(*  Revision: $Revision: 1.2 $                          *)\r
 (*                                                            *)\r
 (*  Contributors: Peter Thornqvist, Troy Wolbrink,            *)\r
 (*                Frank Andreas de Groot, Igor Siticov,       *)\r
@@ -49,6 +49,7 @@ interface
 {$endif}\r
 {$ifdef VER120}\r
   // Delphi 4\r
+  {$DEFINE DELPHI4OROLDER}\r
   {$DEFINE DELPHI5OROLDER}\r
   {$DEFINE DELPHI6OROLDER}\r
 {$endif}\r
@@ -84,8 +85,13 @@ interface
 {$endif}\r
 \r
 uses\r
-{$ifdef DELPHI5OROLDER}\r
-  gnugettextD4, \r
+  TypInfo,\r
+{$ifdef DELPHI4OROLDER}\r
+  gnugettextD4,\r
+{$else}\r
+  {$ifdef DELPHI5OROLDER}\r
+    gnugettextD5,\r
+  {$endif}\r
 {$endif}\r
 \r
 {$ifdef MSWINDOWS}\r
@@ -93,7 +99,7 @@ uses
 {$else}\r
   Libc,\r
 {$endif}\r
-  Classes, SysUtils, TypInfo;\r
+  Classes, SysUtils;\r
 \r
 (*****************************************************************************)\r
 (*                                                                           *)\r
@@ -346,14 +352,6 @@ type
 var\r
   DefaultInstance:TGnuGettextInstance;\r
 \r
-// DELPHI 4\r
-\r
-function GetStrProp(Instance: TObject; const Name: string): string; overload;\r
-function GetStrProp(Instance: TObject; Info: PPropInfo): string; overload;\r
-\r
-procedure SetStrProp(Instance: TObject; const Name, Value: string); overload;\r
-procedure SetStrProp(Instance: TObject; Info: PPropInfo; const Value: string); overload;\r
-\r
 implementation\r
 \r
 (**************************************************************************)\r
@@ -2379,7 +2377,7 @@ begin
   // Find TMoFile object\r
   MoFilesCS.BeginWrite;\r
   try\r
-    idxname:=realfilename+#0+IntToStr(offset);\r
+    idxname:=realfilename+#1+IntToStr(offset);\r
     if MoFiles.Find(idxname, idx) then begin\r
       Result:=MoFiles.Objects[idx] as TMoFile;\r
     end else begin\r
@@ -2794,66 +2792,6 @@ begin
   end;\r
 end;\r
 \r
-// DELPHI4\r
-\r
-function GetPropInfo(Instance: TObject; const Name: string; var PropInfo: TPropInfo): Boolean;\r
-var\r
-  Props: PPropList;\r
-  TypeData: PTypeData;\r
-  Info: PPropInfo;\r
-  i: Integer;\r
-begin\r
-  TypeData := GetTypeData(Instance.ClassInfo);\r
-  if ((TypeData <> nil) and (TypeData^.PropCount > 0)) then\r
-  begin\r
-    GetMem(Props, TypeData^.PropCount * sizeof(Pointer));\r
-    try\r
-      GetPropInfos(Instance.ClassInfo, Props);\r
-      for i := 0 to TypeData.PropCount - 1 do\r
-      begin\r
-        Info := Props[i];\r
-        if (AnsiCompareText(Info.Name, Name) = 0) then\r
-        begin\r
-          PropInfo := Info^;\r
-          Result := True;\r
-          Exit;\r
-        end\r
-      end;\r
-    finally\r
-      FreeMem(Props);\r
-    end;\r
-  end;\r
-  Result := False;\r
-end;\r
-\r
-function GetStrProp(Instance: TObject; Info: PPropInfo): string;\r
-begin\r
-  Result := TypInfo.GetStrProp(Instance, Info);\r
-end;\r
-\r
-function GetStrProp(Instance: TObject; const Name: string): string;\r
-var\r
-  Info: TPropInfo;\r
-begin\r
-  if GetPropInfo(Instance, Name, Info) then\r
-    Result := TypInfo.GetStrProp(Instance, @Info)\r
-  else\r
-    Result := '';\r
-end;\r
-\r
-procedure SetStrProp(Instance: TObject; const Name, Value: string);\r
-var\r
-  Info: TPropInfo;\r
-begin\r
-  if GetPropInfo(Instance, Name, Info) then\r
-    SetStrProp(Instance, @Info, Value);\r
-end;\r
-\r
-procedure SetStrProp(Instance: TObject; Info: PPropInfo; const Value: string);\r
-begin\r
-  TypInfo.SetStrProp(Instance, Info, Value);\r
-end;\r
-\r
 initialization\r
   {$ifdef DXGETTEXTDEBUG}\r
   {$ifdef MSWINDOWS}\r